package su.NewFeatureType;

import iitb.Model.FeatureGenImpl;
import iitb.Model.FeatureImpl;
import iitb.Model.FeatureTypes;
import su.Ner.NerDataSequence;


@SuppressWarnings("serial")
public abstract class StateFeatures extends FeatureTypes {
	
	public StateFeatures(FeatureGenImpl fgen,int _baseId,int _maxFeatureNum) {
		super(fgen);
		baseId=_baseId;
		stateId=-1;
		ystart=-1;
		maxFeatureNum=_maxFeatureNum;
	}

	int stateId;
	public int maxFeatureNum;
	String fname;
	int ystart;
	int tokenId;

	public boolean hasNext() {
		return (stateId != -1);
	}

	public void next(FeatureImpl f) {
		f.strId.init(  baseId-(tokenId*NerDataSequence.labelNum)-stateId   , stateId,
				fname);
		f.yend = stateId;
		f.ystart = ystart;
		f.val = 1;
		stateId++;
		if(stateId==NerDataSequence.labelNum)
			stateId=-1;
	}
	
	void setParams(String _fname,int _tokenId){
		fname=_fname;
		tokenId=_tokenId;
		stateId=0;
	}

};
